package com.simple.vo;

public class WordRegion {
	private int middleX;
	private int middleY;
	private int leftX;
	private int rightX;
	private int topY;
	private int bottomY;
	private float wordWidth;
	private float wordHeight;
	private String boundingBox;

	public WordRegion(String boundingBox) {
		String[] positons = boundingBox.split(",");
		leftX = Integer.parseInt(positons[0]);
		topY = (Integer.parseInt(positons[1]) + Integer.parseInt(positons[3])) / 2;
		rightX = Integer.parseInt(positons[2]);
		bottomY = (Integer.parseInt(positons[5]) + Integer.parseInt(positons[7])) / 2;
		middleX = (leftX + rightX) / 2;
		middleY = (topY + bottomY) / 2;
		wordWidth = rightX - leftX;
		wordHeight = bottomY - topY;
		this.boundingBox = boundingBox;
	}

	public int getMiddleX() {
		return middleX;
	}

	public void setMiddleX(int middleX) {
		this.middleX = middleX;
	}

	public int getMiddleY() {
		return middleY;
	}

	public void setMiddleY(int middleY) {
		this.middleY = middleY;
	}

	public int getLeftX() {
		return leftX;
	}

	public void setLeftX(int leftX) {
		this.leftX = leftX;
	}

	public int getRightX() {
		return rightX;
	}

	public void setRightX(int rightX) {
		this.rightX = rightX;
	}

	public int getTopY() {
		return topY;
	}

	public void setTopY(int topY) {
		this.topY = topY;
	}

	public int getBottomY() {
		return bottomY;
	}

	public void setBottomY(int bottomY) {
		this.bottomY = bottomY;
	}

	public float getWordWidth() {
		return wordWidth;
	}

	public void setWordWidth(float wordWidth) {
		this.wordWidth = wordWidth;
	}

	public float getWordHeight() {
		return wordHeight;
	}

	public void setWordHeight(float wordHeight) {
		this.wordHeight = wordHeight;
	}

	public String getBoundingBox() {
		return boundingBox;
	}

	public void setBoundingBox(String boundingBox) {
		this.boundingBox = boundingBox;
	}
}
